Skip to content

docs: clarify RunResult.events testing surface#5525

Merged
theomonnom merged 1 commit intolivekit:mainfrom
Rul1an:codex/issue-5410-events-docs
Apr 24, 2026
Merged

docs: clarify RunResult.events testing surface#5525
theomonnom merged 1 commit intolivekit:mainfrom
Rul1an:codex/issue-5410-events-docs

Conversation

@Rul1an
Copy link
Copy Markdown
Contributor

@Rul1an Rul1an commented Apr 22, 2026

Fixes #5410

Documents RunResult.events as a small, testing-oriented surface, enumerates the event types it contains, and clarifies that callers should use it for run assertions instead of depending on lower-level session internals or raw media artifacts.

Copilot AI review requested due to automatic review settings April 22, 2026 10:25
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the RunResult.events documentation to define it as the small, testing-oriented surface for asserting what happened during a voice.testing run (per #5410), and clarifies the event types it can contain.

Changes:

  • Expands the RunResult.events docstring to describe its intent (test assertions) and discourage depending on lower-level internals.
  • Enumerates the concrete event wrapper types (ChatMessageEvent, FunctionCallEvent, FunctionCallOutputEvent, AgentHandoffEvent) present in events.
  • Specifies that events are presented in chronological order.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +92 to 93
"""
return self._recorded_items
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

events returns the underlying _recorded_items list directly. Since this docstring now positions RunResult.events as the recommended external testing surface, callers can easily (and accidentally) mutate the list and corrupt the recorded event stream for subsequent assertions/debug output. Consider returning an immutable view (e.g., a tuple) or a shallow copy, or explicitly document that the returned list must be treated as read-only.

Suggested change
"""
return self._recorded_items
Returns a shallow copy of the recorded events so callers cannot mutate
the internal event stream.
"""
return list(self._recorded_items)

Copilot uses AI. Check for mistakes.
@theomonnom theomonnom merged commit 1564321 into livekit:main Apr 24, 2026
20 of 22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: document a small testing-result surface around voice.testing.RunResult.events

4 participants